package com.se;

import java.util.ArrayList;

public class MainActivity {
    public static void main(String[] args) {
        Publisher pub1 = new Publisher(1, new int[]{1, 2, 3});
        Subscriber sub1 = new Subscriber(1, new int[]{});
        Subscriber sub2 = new Subscriber(1, new int[]{});

        sub1.setPub_id(1);
        pub1.AddSub(sub1);
        sub1.setPub_id(2);
        pub1.AddSub(sub2);

        pub1.setMessage(new int[]{1, 5, 8});
        pub1.publish_message();

        int[] test= sub1.getMessage();
        for(int element: test) {
            System.out.println(element);
        }
        test= sub2.getMessage();
        for(int element: test) {
            System.out.println(element);
        }
    }
}
